<template>
  <div class="CPT_Task" :style="taskStyle">
    <Scrollbar class="yscrollbar">
      <div>
        <div v-for="(it, i) in list" :key="i" class="p10">
          <div class="fs12 txt-dark3">{{ it.date }}</div>
          <div class="fs14 txt-dark5">{{ it.content }}</div>
        </div>
      </div>
    </Scrollbar>
  </div>
</template>
<script>
export default {
  inheritAttrs: false,
  name: "CPT_Task",
  props: {
    height: {
      type: [String, Number],
      default: 300,
    },
  },
  computed: {
    taskStyle() {
      const height = parseInt(this.height) || 300
      console.info(height);
      return { height: height + "px" }
    },
  },
  data() {
    return { list: [] }
  },
  created() {
    this.init()
  },
  methods: {
    init() {
      let list = [],
        total = 20
      for (let i = 0; i < total; i++) {
        list.push({
          id: i,
          date: "2022-02-07",
          content: "写代码划水做作业",
        })
      }
      this.list = list
      // return {
      //   list,
      //   total,
      // }
    },
  },
}
</script>
<style lang="scss" scoped></style>
